<template>
	<!-- 公司信息组件-头部 -->
	<view class="Inventory_cntent">
		<view class="Inventory_cntent_header flex jcsb">
			<text class="fonts14 fontc3d fontz fontw700">{{personData.positionName}}</text>
			<text
				class="Inventory_free fontw700 fonts14">{{personData.salaryStart}}-{{personData.salaryEnd}}{{personData.salaryUnit}} {{personData.salaryRange}}薪</text>
			<!-- <text class="Inventory_close fontw700 fonts14">职位已关闭</text> -->
		</view>
		<view class="flex">
			<text class="Inventory_btn"
				v-if="personData.requirementsYears">{{dictFuns(personData.requirementsYears, "requirements_years")}}</text>
			<text class="Inventory_btn"
				v-if="personData.educationRequirements">{{dictFuns(personData.educationRequirements, "education")}}</text>
				<text class="Inventory_btn"
					v-if="personData.isFullTimeEducation==1">{{personData.isFullTimeEducation==1?"全日制":""}}</text>
			<text class="Inventory_btn" v-if="personData.workNature">{{dictFuns(personData.workNature, "work_nature")}}</text>
			<text class="Inventory_btn" v-if="personData.positionNature">{{dictFuns(personData.positionNature, "position_nature")}}</text>
		</view>
		<view class="flex componyheader_cntent_right_text aic">
			<!-- <image src="@/static/compass.png" mode=""></image> -->
			<text class="fontz fonts12 gray">招聘人数：{{personData.recruitmentNumber}}人</text>
		</view>
		<view class="flex componyheader_cntent_right_text aic">
			<text class="fontz fonts12 gray">更新时间：{{personData.createTime}}</text>
		</view>
		<view class="flex componyheader_cntent_right_text aic" v-if="personData.applicationAddress">
			<image src="@/static/map-pin.png" mode=""></image>
			<text class="fontz fonts12 gray">{{personData.applicationAddress}}</text>
		</view>
		<view class="flex componyheader_cntent_right_text ">
			<text class="fontz fonts12 gray" style="width: 100px;margin-top: 8px;">福利待遇：</text>
			<view class="flex" style="margin-bottom: 8px;flex-wrap: wrap;">
				<text class="Inventory_btn_"
					v-for="item in string_arrFun(personData.welfareTreatment)">{{dictFuns(item,'welfare_treatment')}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		dictFun
	} from "@/util/dictionary"
	export default {
		name: "Inventory_detail",
		props: {
			data: {
				type: Object,
				default: {}
			}
		},
		watch: {
			//  如果需要第一次就执行监听 则需要设置：immediate: true
			data: {
				handler(newVal, oldVal) {
					this.personData = this.data
				},
				deep: true
			},
		},
		data() {
			return {
				personData: {}
			}
		},
		created() {
		},
		methods: {
			dictFuns(value, res) {
				return dictFun(value, res)
			},
			string_arrFun(res) {
				console.log(res);

				let arrs = res ? res.split(",") : []
				return arrs
			}

		}
	}
</script>

<style lang="scss" scoped>
	.Inventory_cntent {
		margin-top: 10px;
		padding: 12px 12px 14px 12px;
		width: calc(100% - 24px);
		// height: 74px;
		background: #FFFFFF;
		border-radius: 0px 0px 0px 0px;
		opacity: 1;

		image {
			width: 70px;
			height: 70px;
			margin-right: 13px;

		}
	}

	.componyheader_cntent_right_text {
		image {
			width: 12px;
			height: 12px;
			margin-right: 6px;
		}

		margin-top: 10px;

	}

	.Inventory_free {
		color: #FE6470;
	}

	.Inventory_close {
		color: #979797;
	}

	.Inventory_cntent_header {
		margin-bottom: 5px;
	}

	.Inventory_btn {
		padding: 3px 10px;
		color: #2F6CBC;
		background: #D5E7FF;
		border-radius: 10px 10px 10px 10px;
		font-size: 10px;
		margin-right: 10px;
		margin-top: 5px;
	}

	.Inventory_btn_ {
		padding: 3px 10px;
		color: #2F6CBC;
		border: 1px solid #2F6CBC;
		background: #EFF3F7;
		border-radius: 10px 10px 10px 10px;
		font-size: 10px;
		margin-right: 10px;
		margin-top: 5px;
	}

	.componyheader_cntent_right_text {
		image {
			width: 12px;
			height: 12px;
			margin-right: 6px;
		}

		margin-top: 10px;

	}
</style>
